package com.ml.mall.job;


import com.ml.mall.job.pojo.ScheduleJobDTO;

/**
 * @author kyyang
 */
public interface IBaseJobService {
    /**
     * 添加一个任务
     *
     * @param jobInfo
     */
    void addJob(ScheduleJobDTO jobInfo);

    /**
     * 添加一个任务
     *
     * @param jobInfo
     * @param replace 如果存在是否替换
     */
    void addJob(ScheduleJobDTO jobInfo, boolean replace);



    /**
     * 触发任务
     *
     * @param jobName
     * @param jobGroup
     */
    void triggerJob(String jobName, String jobGroup);
    /**
     * 暂停任务
     *
     * @param jobName
     * @param jobGroup
     */
    void pauseJob(String jobName, String jobGroup);

    /**
     * 恢复任务
     *
     * @param jobName
     * @param jobGroup
     */
    void resumeJob(String jobName, String jobGroup);

    /**
     * 检查任务是否存在
     *
     * @param jobName
     * @param jobGroup
     * @return boolean
     */
    boolean jobExist(String jobName, String jobGroup);

    /**
     * job trigger 是否存在
     *
     * @param jobName
     * @param jobGroup
     * @return boolean
     */
    boolean jobTriggerExist(String jobName, String jobGroup);

    /**
     * 删除job
     *
     * @param jobName
     * @param jobGroup
     */
    void deleteJob(String jobName, String jobGroup);
}
